package com.elinkway.infinitemovies.http.requesttask;

import android.content.Context;

import com.elinkway.infinitemovies.async.MoviesHttpAsyncTask;
import com.elinkway.infinitemovies.bean.UserUpdateBean;
import com.elinkway.infinitemovies.http.api.MoviesHttpApi;
import com.elinkway.infinitemovies.http.parser.UserUpdateParser;
import com.lvideo.http.bean.LVideoDataHull;

/**
 * Created by xiaojian on 16-3-9.
 */
public class RequestUserUpdateTask extends MoviesHttpAsyncTask<UserUpdateBean> {

    private String nickname;
    private String gender;
    private String photo;

    @Override
    public void netNull() {
        super.netNull();
    }

    @Override
    public void netErr(int updateId, String errMsg) {
        super.netErr(updateId, errMsg);
    }

    @Override
    public void dataNull(int updateId, String errMsg) {
        super.dataNull(updateId, errMsg);
    }

    public RequestUserUpdateTask(Context context,String nickname, String gender, String photo) {
        super(context);
        this.nickname = nickname;
        this.gender = gender;
        this.photo = photo;
    }

    @Override
    public LVideoDataHull<UserUpdateBean> doInBackground() {
        LVideoDataHull<UserUpdateBean> ret = MoviesHttpApi.userUpdateRequest(
                new UserUpdateParser(), nickname, gender, photo);
        if (ret.getDataType() == LVideoDataHull.DataType.DATA_IS_INTEGRITY) {
            UserUpdateBean v = ret.getDataEntity();

        }
        return ret;
    }

    @Override
    public void onPostExecute(int updateId, UserUpdateBean result) {
    }
}
